The present disclosure relates generally to management of event counters, and more specifically, to a robust and adaptable management scheme for verifying event counters during a race condition between design and context events.
In general, a context event can be defined as any event that changes the behavior of a counter, while a design event can be defined as any event accumulated in the counter. For example, a context event may be a control register update that modifies an event qualification condition or an exception event that clears the speculative path and restarts an execution from a previous check pointed state, thus impacting accountability of design events in a speculative path.
Verification of counter designs usually requires a reference model and a scoreboard kind of mechanism that compares counter values with that of the reference model. In case of context events, reference models either don't model context changes or closely imitate the counter design for cycle accuracy. There are inherent flaws in both schemes. In the former approach, there is no checking being done in a window where the context changes and the test-bench have to be synchronized with the counter design after the context switch has happened. The latter approach is very time consuming, as it requires a deep understanding of the micro-architectural implementation and it is also high on maintenance due to vulnerability to micro-arch changes. Further, the latter approach also has another disadvantage of not using a high level architecture level specification, but relying on the designers understanding of the architecture. This makes the latter approach susceptible to duplicating design mistakes (if any).